package com.itheima.tcp;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;

/*
tcp的发送端
 */
public class ClientDemo {

    public static void main(String[] args) throws IOException {
        //创建发送短对象
        Socket socket = new Socket("127.0.0.1", 9999);
        //获取输出流
        OutputStream os = socket.getOutputStream();
        //写数据
        os.write("你瞅啥".getBytes());
        //释放资源
        socket.close();


    }
}
